package com.jk.controller;

import com.jk.pojo.DoctorBean;
import com.jk.service.DoctorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author jisiqi
 * @version 1.0
 * @description: TODO  //医生管理表Controller层
 * @date 2022/10/17 11:37
 */
@RestController
@RequestMapping("doctor")
public class DoctorController {

    @Autowired
    private DoctorService doctorService;

    /** 
     * @description: 查询医生管理MySQL并新增es 
     * @param:  
     * @return: java.util.Map 
     * @author 纪思齐
     * @date: 2022/10/17 12:35
     */ 
    @RequestMapping("getDoctorList")
    public Map  getDoctorList(){
        return  doctorService.getDoctorList();
    }

    /**
     * @description: 查看医生管理es+高亮
     * @param: doctorBean
     * @return: java.util.Map
     * @author 纪思齐
     * @date: 2022/10/17 12:56
     */
    @RequestMapping("queryEsList")
    public Map  queryEsList(DoctorBean doctorBean){
        return  doctorService.queryEsList(doctorBean);
    }

    /** 
     * @description:根据医生id删除
     * @param: id 
     * @return: boolean 
     * @author 纪思齐
     * @date: 2022/10/17 19:43
     */ 
    @RequestMapping("deleteDoctorId")
    public  boolean  deleteDoctorId(@RequestParam Integer id){
        return  doctorService.deleteDoctorId(id);
    }

    /**
     * @description:  根据医生id修改
     * @param: id , state
     * @return: boolean
     * @author 纪思齐
     * @date: 2022/10/19 11:41
     */
    @RequestMapping("updateState")
    public boolean updateState(Integer id , Integer state){
        return  doctorService.updateState(id , state);
    }

    /**
    * @Author: binzi
    * @Description:登录精确查
    * @Date: 2022/10/20 16:36
    * @Return: java.util.Map
    **/
    @RequestMapping("login")
    public Map login(DoctorBean bean){
        return doctorService.login(bean);
    }
}
